<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>common_util: src/common_util/datetime.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">common_util
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_2961cad218251a7c35c6867350b80887.html">common_util</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">datetime.h</div></div>
</div><!--header-->
<div class="contents">
<a href="datetime_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#include &lt;regex&gt;</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="keyword">namespace </span>cutl</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span>{</div>
<div class="foldopen" id="foldopen00034" data-start="{" data-end="};">
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4">   34</a></span>    <span class="keyword">enum class</span> <a class="code hl_enumeration" href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4">datetime_format</a></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>    {</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>        <a class="code hl_enumvalue" href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4afc53fb608f9400b917e42c8c643be5a2">datetime_format_a</a>,</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>        <a class="code hl_enumvalue" href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4acb35d671f58ee198728dd4bb5869d919">datetime_format_b</a>,</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>        <a class="code hl_enumvalue" href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4a4e7170b4333cf5c16894c74cc4779eca">datetime_format_c</a>,</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>        <a class="code hl_enumvalue" href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4a5bbd4410e0cdffa6e4e82e48cef15bd9">datetime_format_d</a>,</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>    };</div>
</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span> </div>
<div class="foldopen" id="foldopen00050" data-start="{" data-end="};">
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html">   50</a></span>    <span class="keyword">class </span><a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>    {</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#ad4d844ed6c8d5bb3f7f332001ea17544">   57</a></span>        <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="classcutl_1_1datetime.html#ad4d844ed6c8d5bb3f7f332001ea17544">second</a> = 1000;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a2715f00996ee150322771d662f4513de">   62</a></span>        <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="classcutl_1_1datetime.html#a2715f00996ee150322771d662f4513de">min</a> = 60 * <a class="code hl_variable" href="classcutl_1_1datetime.html#ad4d844ed6c8d5bb3f7f332001ea17544">second</a>;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a04a50a6dbf5c3fdeefbdd7dfdb9a6ecc">   67</a></span>        <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="classcutl_1_1datetime.html#a04a50a6dbf5c3fdeefbdd7dfdb9a6ecc">hour</a> = 60 * <a class="code hl_variable" href="classcutl_1_1datetime.html#a2715f00996ee150322771d662f4513de">min</a>;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a3ad1b6141da3c1a9cab0737c6c227c9c">   72</a></span>        <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="classcutl_1_1datetime.html#a3ad1b6141da3c1a9cab0737c6c227c9c">day</a> = 24 * <a class="code hl_variable" href="classcutl_1_1datetime.html#a04a50a6dbf5c3fdeefbdd7dfdb9a6ecc">hour</a>;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span> </div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#ac6a75875790295481a05a136af4a2439">   80</a></span>        <a class="code hl_function" href="classcutl_1_1datetime.html#ac6a75875790295481a05a136af4a2439">datetime</a>(uint64_t ms);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span> </div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a9d1d9cc43a398a20909754ffa3de7366">   87</a></span>        <a class="code hl_function" href="classcutl_1_1datetime.html#a9d1d9cc43a398a20909754ffa3de7366">datetime</a>(<span class="keyword">const</span> <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> &amp;other);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a5878a7ef4a103f0146647923d1567beb">   93</a></span>        <a class="code hl_function" href="classcutl_1_1datetime.html#a5878a7ef4a103f0146647923d1567beb">~datetime</a>();</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span> </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>        <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a>();</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span> </div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a2f26f17577618f7133b62b0343ecca0c">  104</a></span>        <span class="keyword">static</span> <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> <a class="code hl_function" href="classcutl_1_1datetime.html#a2f26f17577618f7133b62b0343ecca0c">now</a>();</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span> </div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#add0aca89e3efa88a933113e181903be9">  122</a></span>        <span class="keyword">static</span> <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> <a class="code hl_function" href="classcutl_1_1datetime.html#add0aca89e3efa88a933113e181903be9">get</a>(<span class="keyword">const</span> std::string &amp;time_text, <span class="keywordtype">int</span> isdst = -1);</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span> </div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a51fa427db5c0c7da4b4af906a958fdf2">  130</a></span>        uint64_t <a class="code hl_function" href="classcutl_1_1datetime.html#a51fa427db5c0c7da4b4af906a958fdf2">timestamp</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a3b652358d578694167f43d3dfe304e57">  139</a></span>        std::string <a class="code hl_function" href="classcutl_1_1datetime.html#a3b652358d578694167f43d3dfe304e57">format</a>(<a class="code hl_enumeration" href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4">datetime_format</a> dfmt = datetime_format::datetime_format_a, <span class="keywordtype">bool</span> local = <span class="keyword">true</span>, <span class="keywordtype">bool</span> show_milliseconds = <span class="keyword">true</span>) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>        <span class="comment">// fmt, usages like std::put_time</span></div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span> </div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a1cc0a22792d1523874a647a3e336229f">  150</a></span>        std::string <a class="code hl_function" href="classcutl_1_1datetime.html#a1cc0a22792d1523874a647a3e336229f">format</a>(<span class="keyword">const</span> std::string &amp;fmt, <span class="keywordtype">bool</span> local = <span class="keyword">true</span>, <span class="keywordtype">bool</span> show_milliseconds = <span class="keyword">true</span>) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span> </div>
<div class="foldopen" id="foldopen00157" data-start="{" data-end="}">
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a3a0d03eb44d72d49e727d8bf6c6c6517">  157</a></span>        std::string <a class="code hl_function" href="classcutl_1_1datetime.html#a3a0d03eb44d72d49e727d8bf6c6c6517">utctime</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span>            <span class="keywordflow">return</span> <a class="code hl_function" href="classcutl_1_1datetime.html#a3b652358d578694167f43d3dfe304e57">format</a>(datetime_format::datetime_format_a, <span class="keyword">false</span>);</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>        }</div>
</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a894c09f6eb005ed597a1de2392cbf737">  168</a></span>        <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> &amp;<a class="code hl_function" href="classcutl_1_1datetime.html#a894c09f6eb005ed597a1de2392cbf737">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> &amp;other);</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span> </div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a75282bebb7e0f1a9f359d8fc3cc98a3b">  176</a></span>        <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> <a class="code hl_function" href="classcutl_1_1datetime.html#a75282bebb7e0f1a9f359d8fc3cc98a3b">operator+</a>(uint64_t ms);</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span> </div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#ab4eb96ab29e504b7b9037338d2f9d0be">  184</a></span>        <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> <a class="code hl_function" href="classcutl_1_1datetime.html#ab4eb96ab29e504b7b9037338d2f9d0be">operator-</a>(uint64_t ms);</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span> </div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#ad2fc579ef4a4b885b6c52b3bb8716022">  192</a></span>        <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> &amp;<a class="code hl_function" href="classcutl_1_1datetime.html#ad2fc579ef4a4b885b6c52b3bb8716022">operator+=</a>(uint64_t ms);</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span> </div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#a411c0ba1168f95601b8cc2e708959f23">  200</a></span>        <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> &amp;<a class="code hl_function" href="classcutl_1_1datetime.html#a411c0ba1168f95601b8cc2e708959f23">operator-=</a>(uint64_t ms);</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno">  201</span> </div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"><a class="line" href="classcutl_1_1datetime.html#af2de8f10337d6750870393076d1a02d3">  208</a></span>        int64_t <a class="code hl_function" href="classcutl_1_1datetime.html#af2de8f10337d6750870393076d1a02d3">operator-</a>(<span class="keyword">const</span> <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> &amp;other) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno">  209</span> </div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span>        <span class="keyword">using </span>time_regex_type = std::pair&lt;std::string, std::regex&gt;;</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span>        <span class="keyword">using </span>time_regex_vec_type = std::vector&lt;time_regex_type&gt;;</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span>        <span class="keyword">static</span> std::string supported_time_formats(<span class="keyword">const</span> time_regex_vec_type &amp;fmtlist);</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>        <span class="keyword">static</span> <span class="keywordtype">bool</span> verify_time(<span class="keyword">const</span> <span class="keyword">struct</span> tm &amp;time);</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span>        uint64_t timestamp_ms_;</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span>    };</div>
</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span> </div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"><a class="line" href="datetime_8h.html#ade576064506faebb5f0ce249d023b4c4">  227</a></span>    std::ostream &amp;<a class="code hl_function" href="datetime_8h.html#ade576064506faebb5f0ce249d023b4c4">operator&lt;&lt;</a>(std::ostream &amp;os, <span class="keyword">const</span> <a class="code hl_class" href="classcutl_1_1datetime.html">datetime</a> &amp;dt);</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span> </div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span>} <span class="comment">// namespace</span></div>
<div class="ttc" id="aclasscutl_1_1datetime_html"><div class="ttname"><a href="classcutl_1_1datetime.html">cutl::datetime</a></div><div class="ttdoc">A simple, feature-rich modern C++ date-time class.</div><div class="ttdef"><b>Definition</b> datetime.h:51</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a04a50a6dbf5c3fdeefbdd7dfdb9a6ecc"><div class="ttname"><a href="classcutl_1_1datetime.html#a04a50a6dbf5c3fdeefbdd7dfdb9a6ecc">cutl::datetime::hour</a></div><div class="ttdeci">static constexpr int hour</div><div class="ttdoc">Constants value: hour, expressed in milliseconds.</div><div class="ttdef"><b>Definition</b> datetime.h:67</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a1cc0a22792d1523874a647a3e336229f"><div class="ttname"><a href="classcutl_1_1datetime.html#a1cc0a22792d1523874a647a3e336229f">cutl::datetime::format</a></div><div class="ttdeci">std::string format(const std::string &amp;fmt, bool local=true, bool show_milliseconds=true) const</div><div class="ttdoc">Format the datetime object to a string with a custom format string.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a2715f00996ee150322771d662f4513de"><div class="ttname"><a href="classcutl_1_1datetime.html#a2715f00996ee150322771d662f4513de">cutl::datetime::min</a></div><div class="ttdeci">static constexpr int min</div><div class="ttdoc">Constants value: min, expressed in milliseconds.</div><div class="ttdef"><b>Definition</b> datetime.h:62</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a2f26f17577618f7133b62b0343ecca0c"><div class="ttname"><a href="classcutl_1_1datetime.html#a2f26f17577618f7133b62b0343ecca0c">cutl::datetime::now</a></div><div class="ttdeci">static datetime now()</div><div class="ttdoc">Get a datetime object for the current system time.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a3a0d03eb44d72d49e727d8bf6c6c6517"><div class="ttname"><a href="classcutl_1_1datetime.html#a3a0d03eb44d72d49e727d8bf6c6c6517">cutl::datetime::utctime</a></div><div class="ttdeci">std::string utctime() const</div><div class="ttdoc">Get the string of UTC time described by datetime object.</div><div class="ttdef"><b>Definition</b> datetime.h:157</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a3ad1b6141da3c1a9cab0737c6c227c9c"><div class="ttname"><a href="classcutl_1_1datetime.html#a3ad1b6141da3c1a9cab0737c6c227c9c">cutl::datetime::day</a></div><div class="ttdeci">static constexpr int day</div><div class="ttdoc">Constants value: day, expressed in milliseconds.</div><div class="ttdef"><b>Definition</b> datetime.h:72</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a3b652358d578694167f43d3dfe304e57"><div class="ttname"><a href="classcutl_1_1datetime.html#a3b652358d578694167f43d3dfe304e57">cutl::datetime::format</a></div><div class="ttdeci">std::string format(datetime_format dfmt=datetime_format::datetime_format_a, bool local=true, bool show_milliseconds=true) const</div><div class="ttdoc">format the datetime object to a string</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a411c0ba1168f95601b8cc2e708959f23"><div class="ttname"><a href="classcutl_1_1datetime.html#a411c0ba1168f95601b8cc2e708959f23">cutl::datetime::operator-=</a></div><div class="ttdeci">datetime &amp; operator-=(uint64_t ms)</div><div class="ttdoc">Define the subtraction and assignment operator.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a51fa427db5c0c7da4b4af906a958fdf2"><div class="ttname"><a href="classcutl_1_1datetime.html#a51fa427db5c0c7da4b4af906a958fdf2">cutl::datetime::timestamp</a></div><div class="ttdeci">uint64_t timestamp() const</div><div class="ttdoc">Get the timestamp in milliseconds.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a5878a7ef4a103f0146647923d1567beb"><div class="ttname"><a href="classcutl_1_1datetime.html#a5878a7ef4a103f0146647923d1567beb">cutl::datetime::~datetime</a></div><div class="ttdeci">~datetime()</div><div class="ttdoc">Destroy the datetime object.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a75282bebb7e0f1a9f359d8fc3cc98a3b"><div class="ttname"><a href="classcutl_1_1datetime.html#a75282bebb7e0f1a9f359d8fc3cc98a3b">cutl::datetime::operator+</a></div><div class="ttdeci">datetime operator+(uint64_t ms)</div><div class="ttdoc">Define the addition operator.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a894c09f6eb005ed597a1de2392cbf737"><div class="ttname"><a href="classcutl_1_1datetime.html#a894c09f6eb005ed597a1de2392cbf737">cutl::datetime::operator=</a></div><div class="ttdeci">datetime &amp; operator=(const datetime &amp;other)</div><div class="ttdoc">Define the assignment operator.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_a9d1d9cc43a398a20909754ffa3de7366"><div class="ttname"><a href="classcutl_1_1datetime.html#a9d1d9cc43a398a20909754ffa3de7366">cutl::datetime::datetime</a></div><div class="ttdeci">datetime(const datetime &amp;other)</div><div class="ttdoc">Construct a new datetime object.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_ab4eb96ab29e504b7b9037338d2f9d0be"><div class="ttname"><a href="classcutl_1_1datetime.html#ab4eb96ab29e504b7b9037338d2f9d0be">cutl::datetime::operator-</a></div><div class="ttdeci">datetime operator-(uint64_t ms)</div><div class="ttdoc">Define the subtraction operator.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_ac6a75875790295481a05a136af4a2439"><div class="ttname"><a href="classcutl_1_1datetime.html#ac6a75875790295481a05a136af4a2439">cutl::datetime::datetime</a></div><div class="ttdeci">datetime(uint64_t ms)</div><div class="ttdoc">Construct a new datetime object.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_ad2fc579ef4a4b885b6c52b3bb8716022"><div class="ttname"><a href="classcutl_1_1datetime.html#ad2fc579ef4a4b885b6c52b3bb8716022">cutl::datetime::operator+=</a></div><div class="ttdeci">datetime &amp; operator+=(uint64_t ms)</div><div class="ttdoc">Define the addition and assignment operator.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_ad4d844ed6c8d5bb3f7f332001ea17544"><div class="ttname"><a href="classcutl_1_1datetime.html#ad4d844ed6c8d5bb3f7f332001ea17544">cutl::datetime::second</a></div><div class="ttdeci">static constexpr int second</div><div class="ttdoc">Constants value: second, expressed in milliseconds.</div><div class="ttdef"><b>Definition</b> datetime.h:57</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_add0aca89e3efa88a933113e181903be9"><div class="ttname"><a href="classcutl_1_1datetime.html#add0aca89e3efa88a933113e181903be9">cutl::datetime::get</a></div><div class="ttdeci">static datetime get(const std::string &amp;time_text, int isdst=-1)</div><div class="ttdoc">Constructs a datetime object from a local time string.</div></div>
<div class="ttc" id="aclasscutl_1_1datetime_html_af2de8f10337d6750870393076d1a02d3"><div class="ttname"><a href="classcutl_1_1datetime.html#af2de8f10337d6750870393076d1a02d3">cutl::datetime::operator-</a></div><div class="ttdeci">int64_t operator-(const datetime &amp;other) const</div><div class="ttdoc">Define the subtraction operator between two datetime objects.</div></div>
<div class="ttc" id="adatetime_8h_html_a4e11bf4fcf504b16f185690443d143b4"><div class="ttname"><a href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4">cutl::datetime_format</a></div><div class="ttdeci">datetime_format</div><div class="ttdoc">the string datetime format for parsing and formatting</div><div class="ttdef"><b>Definition</b> datetime.h:35</div></div>
<div class="ttc" id="adatetime_8h_html_a4e11bf4fcf504b16f185690443d143b4a4e7170b4333cf5c16894c74cc4779eca"><div class="ttname"><a href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4a4e7170b4333cf5c16894c74cc4779eca">cutl::datetime_format::datetime_format_c</a></div><div class="ttdeci">@ datetime_format_c</div></div>
<div class="ttc" id="adatetime_8h_html_a4e11bf4fcf504b16f185690443d143b4a5bbd4410e0cdffa6e4e82e48cef15bd9"><div class="ttname"><a href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4a5bbd4410e0cdffa6e4e82e48cef15bd9">cutl::datetime_format::datetime_format_d</a></div><div class="ttdeci">@ datetime_format_d</div></div>
<div class="ttc" id="adatetime_8h_html_a4e11bf4fcf504b16f185690443d143b4acb35d671f58ee198728dd4bb5869d919"><div class="ttname"><a href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4acb35d671f58ee198728dd4bb5869d919">cutl::datetime_format::datetime_format_b</a></div><div class="ttdeci">@ datetime_format_b</div></div>
<div class="ttc" id="adatetime_8h_html_a4e11bf4fcf504b16f185690443d143b4afc53fb608f9400b917e42c8c643be5a2"><div class="ttname"><a href="datetime_8h.html#a4e11bf4fcf504b16f185690443d143b4afc53fb608f9400b917e42c8c643be5a2">cutl::datetime_format::datetime_format_a</a></div><div class="ttdeci">@ datetime_format_a</div></div>
<div class="ttc" id="adatetime_8h_html_ade576064506faebb5f0ce249d023b4c4"><div class="ttname"><a href="datetime_8h.html#ade576064506faebb5f0ce249d023b4c4">cutl::operator&lt;&lt;</a></div><div class="ttdeci">std::ostream &amp; operator&lt;&lt;(std::ostream &amp;os, const datetime &amp;dt)</div><div class="ttdoc">Define the output stream operator for datetime object.</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>
